#pragma once

/// <summary>
/// ModelData: Encapsulates the unique Initialised data for models. Data includes a model's
/// vertex/index buffers, AABB, and ModelType array. ModelType array is needed to build the buffers.
/// <summary>

/**	Author: Dane Bulat
  * Created: 06/2013
  * Last Modified: 30/06/2013
  * Version: v1.0
  */

// Includes
#include <D3D11.h>
#include "common\xnacollision.h"
#include "ModelUtil.h"

#include <vector>
#include <string>
using namespace std;


// Class Definition
class ModelData
{
public:
//==============================
// Constructors / Destructors
//==============================

  /**
    * Constructor
	*
	* @param Pointer to D3D Device.
	* @param String containing filename of model.
	*/
	ModelData(ID3D11Device* device, const string& modelFilename);

	/// Default Destructor
	~ModelData();

	/// Shutdown method for releasing and deleting member variables.
	void Shutdown();
	
//==============================
// Getters
//==============================

	/// Get Model Vertex Buffer.
	ID3D11Buffer*			GetVertexBuffer() const;

	/// Get Model Index Buffer.
	ID3D11Buffer*			GetIndexBuffer() const;

	/// Get Model Axis Aligned Collision Box.
	XNA::AxisAlignedBox*	GetAABBp();

	// Get Model Index Count.
	unsigned int			GetIndexCount() const;

private:

  /**
    * Initialiser
	*
	* @param Pointer to D3D Device.
	* @param String containing filename of model.
	*/
	bool Initialise(ID3D11Device* device, const string& modelFilename);

private:
	vector<ModelType*>		m_ModelTypeArray;	///< vector storing modeltype pointers.
	ID3D11Buffer*			m_VertexBuffer;		///< Pointer to model vertex buffer.
	ID3D11Buffer*			m_IndexBuffer;		///< Pointer to model index buffer.
	XNA::AxisAlignedBox		m_AABB;				///< Instance of AxisAlignedBox.
	
	unsigned int			m_indexCount;		///< Index Count of the model.
};